.class Lrexsee/multimedia/CameraPreviewDialog$1;
.super Ljava/lang/Object;
.source "CameraPreviewDialog.java"

# interfaces
.implements Landroid/view/SurfaceHolder$Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/multimedia/CameraPreviewDialog;->start(ILjava/lang/Runnable;Lrexsee/multimedia/CameraPreviewDialog$OnCameraPreviewKeyDown;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/multimedia/CameraPreviewDialog;

.field private final synthetic val$orientation:I

.field private final synthetic val$startedRunnable:Ljava/lang/Runnable;


# direct methods
.method constructor <init>(Lrexsee/multimedia/CameraPreviewDialog;ILjava/lang/Runnable;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iput p2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->val$orientation:I

    iput-object p3, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->val$startedRunnable:Ljava/lang/Runnable;

    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lrexsee/multimedia/CameraPreviewDialog$1;)Lrexsee/multimedia/CameraPreviewDialog;
    .locals 1

    .prologue
    .line 23
    iget-object v0, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    return-object v0
.end method


# virtual methods
.method public surfaceChanged(Landroid/view/SurfaceHolder;III)V
    .locals 0
    .param p1, "holder"    # Landroid/view/SurfaceHolder;
    .param p2, "format"    # I
    .param p3, "w"    # I
    .param p4, "h"    # I

    .prologue
    .line 26
    return-void
.end method

.method public surfaceCreated(Landroid/view/SurfaceHolder;)V
    .locals 6
    .param p1, "holder"    # Landroid/view/SurfaceHolder;

    .prologue
    .line 30
    :try_start_0
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    invoke-static {}, Landroid/hardware/Camera;->open()Landroid/hardware/Camera;

    move-result-object v3

    iput-object v3, v2, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    .line 31
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v2, v2, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    new-instance v3, Lrexsee/multimedia/CameraPreviewDialog$1$1;

    invoke-direct {v3, p0}, Lrexsee/multimedia/CameraPreviewDialog$1$1;-><init>(Lrexsee/multimedia/CameraPreviewDialog$1;)V

    invoke-virtual {v2, v3}, Landroid/hardware/Camera;->setErrorCallback(Landroid/hardware/Camera$ErrorCallback;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 48
    :try_start_1
    const-class v2, Landroid/hardware/Camera;

    const-string v3, "setDisplayOrientation"

    invoke-static {v2, v3}, Lrexsee/core/utilities/RexseeClazz;->getMethod(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Method;

    move-result-object v1

    .line 49
    .local v1, "method":Ljava/lang/reflect/Method;
    if-eqz v1, :cond_0

    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v2, v2, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    iget v5, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->val$orientation:I

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 52
    .end local v1    # "method":Ljava/lang/reflect/Method;
    :cond_0
    :goto_0
    :try_start_2
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v2, v2, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    invoke-virtual {v2, p1}, Landroid/hardware/Camera;->setPreviewDisplay(Landroid/view/SurfaceHolder;)V

    .line 53
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v2, v2, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    invoke-virtual {v2}, Landroid/hardware/Camera;->startPreview()V

    .line 54
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->val$startedRunnable:Ljava/lang/Runnable;

    if-eqz v2, :cond_1

    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->val$startedRunnable:Ljava/lang/Runnable;

    invoke-interface {v2}, Ljava/lang/Runnable;->run()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    .line 58
    :cond_1
    :goto_1
    return-void

    .line 55
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 56
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    # getter for: Lrexsee/multimedia/CameraPreviewDialog;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v2}, Lrexsee/multimedia/CameraPreviewDialog;->access$0(Lrexsee/multimedia/CameraPreviewDialog;)Lrexsee/core/browser/Browser;

    move-result-object v2

    if-eqz v2, :cond_1

    iget-object v2, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    # getter for: Lrexsee/multimedia/CameraPreviewDialog;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v2}, Lrexsee/multimedia/CameraPreviewDialog;->access$0(Lrexsee/multimedia/CameraPreviewDialog;)Lrexsee/core/browser/Browser;

    move-result-object v2

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1

    .line 50
    .end local v0    # "e":Ljava/lang/Exception;
    :catch_1
    move-exception v2

    goto :goto_0
.end method

.method public surfaceDestroyed(Landroid/view/SurfaceHolder;)V
    .locals 2
    .param p1, "holder"    # Landroid/view/SurfaceHolder;

    .prologue
    .line 61
    iget-object v0, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v0, v0, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    if-eqz v0, :cond_0

    .line 63
    :try_start_0
    iget-object v0, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v0, v0, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    invoke-virtual {v0}, Landroid/hardware/Camera;->stopPreview()V

    .line 64
    iget-object v0, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v0, v0, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    invoke-virtual {v0}, Landroid/hardware/Camera;->release()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 67
    :goto_0
    iget-object v0, p0, Lrexsee/multimedia/CameraPreviewDialog$1;->this$0:Lrexsee/multimedia/CameraPreviewDialog;

    const/4 v1, 0x0

    iput-object v1, v0, Lrexsee/multimedia/CameraPreviewDialog;->camera:Landroid/hardware/Camera;

    .line 69
    :cond_0
    return-void

    .line 65
    :catch_0
    move-exception v0

    goto :goto_0
.end method
